<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>关闭广告</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            position: relative;
            margin: 100px 500px;
        }

        .box span {
            position: absolute;
            top: 0px;
            width: 20px;
            height: 20px;
            font-size: 10px;
            text-align: center;
            padding-top: 2.5px;
            color: #ccc;
            border: 1px solid #ccc;
            box-sizing: border-box;
        }

        .box span:hover {
            cursor: pointer;
        }

        .box1 {
            position: absolute;
            width: 200px;
            height: 230px;
            left: 20px;
            color: red;
            font-size: 20px;
            border: 1px solid #ccc;
            text-align: center;
        }

        .box1 p {
            margin: 10px 0;
        }

        .box1 img {
            width: 80%;

        }
    </style>
</head>

<body>
    <div class='box'>
        <span style="background-color: chocolate;">x</span>
        <div class='box1'>
            <p>淘宝二维码</p>
            <img src="images/tao.png" alt="">
        </div>
    </div>
    <script>
        var span = document.querySelector('span');
        var box = document.querySelector('.box');
        span.onclick = function () {
            box.style.display = 'none';
        }
    </script>
</body>
</html>